﻿using QuartzServices.Domain.CommandHandlers.BOM.Commands;
using QuartzServices.Domain.Core.Bus;

namespace QuartzServices.Application.BOM
{
    public interface IBlcSapLocationSyncApplication
    {
        /// <summary>
        /// 按页获取BOM
        /// </summary>
        /// <returns></returns>
        Task BlcSapLocationSync();
    }

    public class BlcSapLocationSyncApplication : IBlcSapLocationSyncApplication
    {
        private readonly IMediatorHandler _bus;

        public BlcSapLocationSyncApplication(IMediatorHandler bus)
        {
            _bus = bus;
        }

        /// <summary>
        /// 按页获取BOM
        /// </summary>
        /// <returns></returns>
        public async Task BlcSapLocationSync()
        {
            await _bus.SendCommand(new BlcSapLocationSyncCommand());
        }
    }
}
